<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'repaymentImport.label', default: 'EstateImport')}"/>
    <title><g:message code="default.list.label" args="[entityName]"/></title>
    <asset:stylesheet src="styles/css/importData.css"/>
</head>

<body>
<div>
    %{--header--}%
    <div class="normalheader small-header">
        <div class="hpanel">
            <div class="panel-body">
                <div id="hbreadcrumb">
                    <ol class="hbreadcrumb breadcrumb">
                        <li><a href="#">系统管理</a></li>
                        <li class="active">
                            <span>数据导入</span>
                        </li>
                        <li class="active">
                            <span>搜索</span>
                        </li>
                    </ol>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="hpanel tabMg">
    <div class="panel-body">
        <div class="table-responsive">
            <table cellpadding="1" cellspacing="1" class=" table table-hover table-bordered dataTab" id="example1">
                <thead>
                <tr>
                    <th class="text-center"></th>
                    <th class="text-center">所属机构</th>
                    <th class="text-center">批次名</th>
                    <th class="text-center">导入目的</th>
                    <th class="text-center">押品笔数</th>
                    <th class="text-center">匹配笔数</th>
                    <th class="text-center">处理状态</th>
                    <th class="text-center">导入经手人</th>
                    <th class="text-center">导入时间</th>
                    <th class="text-center">操作</th>
                </tr>
                </thead>
                <tbody>
                <g:each in="${repaymentImportList}">
                    <tr class="text-center">
                        <td>${it?.id}</td>
                        <td>${it?.provinceName}</td>
                        <g:if test="${estateImportBatchList.id}=${estateImportList.batch.id}">
                            <g:each in="${estateImportBatchList}">
                                <td>${it?.batchNumber}</td>
                                <td>新增</td>
                                <td>${it?.estateNum}</td>
                                <td>${it?.matchNum}</td>
                                <td>${it?.status}</td>
                                <td>${it?.createBy}</td>
                                <td><g:formatDate date="${it?.createdDate}"
                                                  format="yyyy-MM-dd "></g:formatDate></td>
                                <td>
                            </g:each>
                        </g:if>
                        <button type="button" class="btn w-xs btn-default">导出匹配失败押品</button>
                    </td>
                    </tr>
                </g:each>
        </div>
    </tbody>
    </table>
        <div class="panel-footer">
            <div class="pagination">
                <g:paginate total="${estateImportCount ?: 0}" params="${params}"/>
            </div>
        </div>
        %{--  <div class="dataTables_paginate paging_simple_numbers footerNum" id="example1_paginate">
              <ul class="pagination">
                  <li class="paginate_button previous disabled" id="example1_previous"><a href="#"
                                                                                          aria-controls="example1"
                                                                                          data-dt-idx="0"
                                                                                          tabindex="0">Previous</a>
                  </li>
                  <li class="paginate_button active"><a href="#" aria-controls="example1" data-dt-idx="1"
                                                        tabindex="0">1</a></li>
                  <li class="paginate_button "><a href="#" aria-controls="example1" data-dt-idx="2" tabindex="0">2</a>
                  </li>
                  <li class="paginate_button "><a href="#" aria-controls="example1" data-dt-idx="3" tabindex="0">3</a>
                  </li>
                  <li class="paginate_button "><a href="#" aria-controls="example1" data-dt-idx="4" tabindex="0">4</a>
                  </li>
                  <li class="paginate_button "><a href="#" aria-controls="example1" data-dt-idx="5" tabindex="0">5</a>
                  </li>
                  <li class="paginate_button next" id="example1_next"><a href="#" aria-controls="example1"
                                                                         data-dt-idx="6"
                                                                         tabindex="0">Next</a></li>
              </ul>
          </div>
      </div>--}%

    <div class="modal fade hmodal-warning" id="myModal7" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog">
            <g:form controller="estateImport" action="excelImport" method="post" enctype="multipart/form-data">
                <div class="modal-content">
                    <div class="modal-body dataModal">
                        <div class="form-group">
                            <label class="col-md-3 control-label lineLab">批次名</label>

                            <div class="col-md-9"><input type="text" id="batch" name="batch" placeholder="请输入批次名"
                                                         class="form-control"></div>
                        </div>

                        <div class="form-group col-md-12">
                            <label class="col-md-3 control-label lineLab">处理状态</label>

                            <div class="col-md-9">
                                <select class="form-control m-b" name="status" id="status">
                                    <option>请选择处理状态</option>
                                    <option>等待处理</option>
                                    <option>处理完成</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group col-md-9 col-md-offset-3">
                            <a href='javascript:void(0);' class="blueButton">选择文件</a>
                            <input type="file" name="myFile" id="myFile" class="myFileUpload"/>

                            <div class="show"></div>
                        </div>

                        %{-- <div class="form-group">
                             <div class="col-md-9 col-md-offset-3"><p class="importPro"><i
                                     class="pe-7s-info"></i>选择文件格式错误!</p></div>
                         </div>--}%
                    </div>

                    <div class="modal-footer">
                        <button type="button" class="btn btn-default">下载导入模板</button>
                        <button class="btn btn-default dataImport">
                            <input type="submit" value="导入">
                        </button>
                        <button class=" btn cancel" tabindex="2" style="display: inline-block; box-shadow: none;"
                                data-dismiss="modal">关闭</button>
                    </div>
                </div>
            </g:form>
        </div>
    </div>
</div>

<script>

    $(function () {
        //导入弹出

        /* $(".dataImport").click(function(){
             swal({
                 title: "导入成功",
                 text: "",
                 type: "success"
             })
         });*/
        /*    $(".dataImport").click(function(){
                swal({
                    title: "导入失败",
                    text: "",
                    type: "error"
                })
            });*/
        //日期控件调用
        $('#datepicker').datepicker({
            language: 'zh-CN'
        });
        //分页器调用
        $('#example1').footable();
        //上传文件按钮
        $(".myFileUpload").change(function () {
            var arrs = $(this).val().split('\\');
            var filename = arrs[arrs.length - 1];
            $(".show").html(filename);
        });
    })

</script>
</body>
</html>